package com.jboost.modules.open.controller;


import com.alibaba.fastjson.JSONObject;
import com.jboost.common.api.vo.Result;
import com.jboost.modules.open.vo.QiniuCallbackVo;
import com.jboost.modules.open.service.IOpenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 *@ClassName
 *@Description
 *@Author cxn
 *@Date 2022-12-07
 *@Version
 **/
@Api(tags="开放接口")
@RestController
@RequestMapping("/open/qiniu")
@Slf4j
public class OpenController {
	@Resource
	private IOpenService openService;

	@ApiOperation(value="任务回调", notes="任务回调")
	@PostMapping(value = "/taskCallBack")
	public Result<String> taskCallBack(@RequestBody QiniuCallbackVo vo) {
		log.info("*****taskCallBack*******任务回调********");
		log.info( JSONObject.toJSONString(vo) );
		openService.qiniuCallback(vo);
		return Result.OK("success");
	}
}
